<?php $this->load->view("header");?>
 <!-- Page Content -->
<div class="wrap-content wrap-content-app wrap-project">
    <div class="container">
        <div class="row">
            <div class="list-search-project col-lg-12 col-xs-12 col-md-12 col-sm-12">
                <div class="frm-search frm-search-freelancer col-lg-6 col-xs-12 col-md-6 col-lg-offset-3 col-md-offset-3">
                <form method="POST" action="<?php echo site_url('search')?>">
                    <input type="name" name="keyword" class="form-control" id="exampleInputEmail1" placeholder='Tìm việc bạn cần. ví dụ "làm app cho iphone"'>
                    <button name="search" type="submit"><span class="glyphicon glyphicon-search"></span></button>
                </form>
                </div> <!-- frm-search -->
                <div class="col-lg-12 col-xs-12 content-list-search-project">
                    <?php
                        if(count($groupCategories) > 0){
                            foreach($groupCategories as $item){
                    ?>
                    <div class="col-lg-4">
                        <p class="x8-16-b"><?php echo $item['group_name'];?></p>
                    <?php
                        if(!empty($item['categories'])){
                    ?>
                        <ul>
                    <?php
                            foreach($item['categories']->result() as $item_categories){
                    ?>
                            <li><a href="<?php echo site_url('project/category/'.$item_categories->name)?>"><?php echo $item_categories->name;?></a></li>
                    <?php
                            }
                    ?>
                        </ul>
                    <?php } ?>
                    </div>
                    <?php } }?>
                </div>
            </div> <!-- list-search-project -->
            <div class="list-project col-lg-12">
                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-16-b text-center">
                    Các dự án hợp với kỹ năng của bạn
                </div>
                <div class="freelancer-pagination text-center col-lg-12 col-md-12 col-sm-12">
                      <?php

                      	if(isset($pagination)) 
                      		echo $pagination;
                      ?>
                </div> <!-- freelancer pagination -->
                <div class="table-list-project table-responsive col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table class="col-lg-12 table  col-md-12 col-sm-12 col-xs-12">
                        <tr class="x8-16-b">
                            <td class="col-lg-4">Tên dự án</td>
                            <td class="col-lg-1">Bid</td>
                            <td class="col-lg-3">Kỹ năng</td>
                            <td class="col-lg-2">Khởi tạo</td>
                            <td class="col-lg-2">Ngân sách</td>
                        </tr>
                        <?php
                        	if(isset($joblistprojects)){
                        		foreach ($joblistprojects->result() as $project) {
                        ?>
                        <tr class="x8-15">
                            <td class="xanh-13-b"><a href="<?php echo site_url('project/view/'.$project->id)?>"><?php echo $project->project_name; ?></a>
                                <div class="rating-freelancer col-lg-12">
                                    <input value="0" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5 step=0.5 data-size="xs" >
                                </div> <!-- rating-freelancer -->
                            </td>
                            <td><?php echo getNumBid($project->id);?></td>
                            <td class="xanh-15"><?php echo getCategoryLinks($project->project_categories); ?></td>
                            <td><?php
                                if(date("d/m/y") == date("d/m/y",$project->created))
                                       echo "Hôm nay";
                                else
                                       echo date("d/m/y", $project->created);?></td>
                            <td>Từ $<?php echo $project->budget_min?> - $<?php echo $project->budget_max?></td>
                        </tr>
                        <tr>
                            <td class="col-lg-9 col-sm-6 col-md-6 desc-list-project" colspan="3"><?php echo $project->description; ?></td>
                            <td colspan="2" class="col-lg-3 col-sm-6 col-md-6">
                                <div class="col-lg-12 col-sm-12">
                                <button type="button" onclick="window.location = '<?php echo site_url('project/create')?>'" class="btn btn-primary btn-lg btn-block">Đăng một dự án giống vậy</button>
                                </div>
                            </td>
                        </tr>
                        <?php
                        		}
                        	}
                        ?>
                        
                    </table>
                </div> <!-- table-list-project -->
                <div class="freelancer-pagination text-center col-lg-12 col-md-12 col-sm-12">
                      <?php if(isset($pagination)) echo $pagination;?>
                </div> <!-- freelancer pagination -->
            </div> <!-- list-project -->
        </div> <!-- end row content -->
    </div>
</div> <!-- wrap-content -->

<?php $this->load->view('footer'); ?>